<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<div class="recommended">
	<c:forEach items="${recommendedTypeList}" var="recommendedType">
		<div class="box_01">
			<div class="top">
				<div class="cnt">
					<h3>${recommendedType.recommendTitle}</h3>
				</div>
			</div>
			<div class="content">
				<div class="box_02">
					<div class="top">
						<c:choose>
							<c:when test = "${recommendedType.autoEval==1}">
								<h3><fmt:message key = "productFormRecommended.autoEval.on"/></h3>
								<div class="do">
									<a class="open" id="autoEvalShowBtn_${recommendedType.recommendedTypeId}" href="#" onclick="showAutoEvalProducts(this,${recommendedType.recommendedTypeId});return false">
											<i></i><fmt:message key = "productFormRecommended.autoEval.show"/>
									</a>
									
									<a class="close" id="autoEvalCloseBtn_${recommendedType.recommendedTypeId}" href="#" onclick="closeAutoEvalProducts(this,${recommendedType.recommendedTypeId});return false" style="display:none">
											<i></i><fmt:message key = "productFormRecommended.autoEval.close"/>
									</a>
									
										
								</div>	
							</c:when>
							<c:when test = "${recommendedType.autoEval==2}">
								<h3><fmt:message key = "productFormRecommended.autoEval.not"/></h3>	
							</c:when>
							<c:otherwise>
								<h3><fmt:message key = "productFormRecommended.autoEval.off"/>	</h3>
							</c:otherwise>
						</c:choose>
					</div>
					<div class="content" id="autoEvalArea_${recommendedType.recommendedTypeId}" style="display:none;">
						<ul id="autoEvalProductsDiv_${recommendedType.recommendedTypeId}" class="prod_arrange_01 clearfix">
						</ul>
						<input type="button" class="btn2" href="javascript:void(0)" onclick="reAutoEvalProducts(${recommendedType.recommendedTypeId})" value="<fmt:message key="productDetail.recommendResult.reEval"/>" />
					</div>	
				</div>
				<div class="box_03">
					<div class="top">
						<h3>
							<c:choose>
								<c:when test = "${recommendedType.autoEval==1}">
									<fmt:message key = "productFormRecommended.manual.title"/>
								</c:when>
								<c:when test = "${recommendedType.autoEval==2}">
									<fmt:message key = "productFormRecommended.manual.title2"/>
								</c:when>
								<c:otherwise>
									<fmt:message key = "productFormRecommended.manual.title2"/>
								</c:otherwise>
							</c:choose>	
								
						</h3>
						<div class="do">
							<a href="javascript:void(0)" onclick="selectRecommendedProduct(${recommendedType.recommendedTypeId});return false" class="add2">
								<i></i><fmt:message key = "button.add"/>
							</a>
							<a href="javascript:void(0)" onclick="removeAllRecommendedProduct(${recommendedType.recommendedTypeId});return false" class="empty">
								<i></i><fmt:message key = "button.clear"/>
							</a>
						</div>
					</div>	
					<div class="content">
						<div class="scroll_box">
							<table cellspacing="0" cellpadding="0" border="0">
								<tr id="manualProductsDiv_${recommendedType.recommendedTypeId}"></tr>
							</table>
						</div>
					</div>		
				</div>
			</div>	
		</div>
	</c:forEach>	
</div>	

<script type="text/javascript">
$j(document).ready(function () {
	<%--start:初始化关联商品--%>
	<c:forEach items="${product.recommendedProducts}" var="rp">
		addManulProduct({"id":"${rp.product.productId}","name":"${rp.product.productName}","imageUrl":"${rp.product.imageUrl}"},${rp.recommendedType.recommendedTypeId});
	</c:forEach>
	<%--end:初始化关联商品--%>
	
	<%--start:sortable--%>
	<c:forEach items="${recommendedTypeList}" var="recommendedType">
		$j('#manualProductsDiv_${recommendedType.recommendedTypeId}').sortable();
	</c:forEach>
	<%--end:  sortable--%>
});	
</script>	

